package com.emersonprocess.danpacmobile;

import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentActivity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.LinearLayout;

public class FragMenu extends Fragment {

	private FragmentActivity mainFragment;

	@Override
	public void onActivityCreated(Bundle savedInstanceState) {
		super.onActivityCreated(savedInstanceState);
		mainFragment = getActivity();
	}

	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {

		View fragmentView = null;
		fragmentView = inflater.inflate(R.layout.frag_menu, null);

		LinearLayout llHome = (LinearLayout) fragmentView.findViewById(R.id.menu_ll_home);
		llHome.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				startActivity(new Intent(mainFragment,FragActHome.class));

			}
		});

		LinearLayout llReports = (LinearLayout) fragmentView.findViewById(R.id.menu_ll_reports);
		llReports.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				startActivity(new Intent(mainFragment,FragActReports.class));

			}
		});

		LinearLayout llTrends = (LinearLayout) fragmentView.findViewById(R.id.menu_ll_trends);
		llTrends.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				startActivity(new Intent(mainFragment,FragActTrends.class));

			}
		});

		LinearLayout llAlerts = (LinearLayout) fragmentView.findViewById(R.id.menu_ll_alerts);
		llAlerts.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				startActivity(new Intent(mainFragment,FragActAlerts.class));


			}
		});

		
		
		LinearLayout llHelp = (LinearLayout) fragmentView.findViewById(R.id.menu_ll_help);
		llHelp.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				startActivity(new Intent(mainFragment,FragActHelp.class));

			}
		});
		
		LinearLayout llLogOut = (LinearLayout) fragmentView.findViewById(R.id.menu_ll_logout);
		llLogOut.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				startActivity(new Intent(mainFragment,FragActLogin.class));

			}
		});

		return fragmentView;

	}

}
